﻿@model List<apiApplication1.Controllers.Product>

@{
    ViewBag.Title = "List";
}

<h2>商品列表</h2>
<table>
    <thead>
        <tr>
            <td>编号</td>
            <td>名称</td>
            <td>价格</td>
        </tr>
    </thead>
    <tbody data-bind="templete:{name:list,foreach:product}">
    </tbody>
    <script type="text/html">
        <tr>
            <td data-bind="text:id"></td>
            <td data-bind="text:name"></td>
            <td data-bind="text:price"></td>
        </tr>
    </script>
</table>

<script>
    var product  =@Html.Raw(Json.Encode(Model));
    ko.applyBindings(product);

</script>
